<include file="Public:head" title='模板类别' />
<script src="__PUBLIC__/js/other/validate.js"></script>
<script type="text/javascript">
    $(function() {
        $("#form").validate({
            errorPlacement: function(error, element) {
                var error_td = element.parent('td');
                error_td.find('label.error').hide();
                error_td.append(error);
            },
            rules: {
                name: {
                    required: true
                }

            },
            messages: {
                name: {
                    required: '模板类别不能为空'
                }

            }
        });
    });
</script>
<div class="main-container" id="main-container">
    <div class="main-container-inner">
        <include file="Public:left" />
        <div class="main-content">
            <div class="breadcrumbs" id="breadcrumbs">
                <ul class="breadcrumb">
                    <li><i class="icon-home home-icon"></i><a href="__APP__/{$Think.MODULE_NAME}">首页</a></li>
                    <li><a href="{:U('Modals/cat')}">模板类别管理</a></li>
                    <li class="active">类别{$Think.get.id|getPageType}</li>
                </ul>
            </div>
            <div class="page-content">
                <div class="row">
                    <div class="col-xs-12">
                        <div class="row">
                            <div class="col-xs-12">
                                <h3 class="header smaller lighter blue">类别{$Think.get.id|getPageType}</h3>

                                <form action="{:U('Modals/cat_detail_post')}" method="POST" id="form">
                                    <table class="table table_detail">
                                        <tbody>
                                            <tr>
                                                <td class="td_left">类别名称:</td>
                                                <td>
                                        <if condition="$detail.id gt 0">
                                            <input name="name"  type="text" class="common_txt"  value="{$detail.name}"/>
                                            <else/>
                                            <input name="name[]" id="name" type="text" class="common_txt"  value="{$detail.name}"/>
                                            <a onclick="addNames()">+添加名称</a>
                                        </if>
                                        </td>
                                        </tr>
                                        <tr id="tr_name">
                                            <td class="td_left"> 上级分类:</td>
                                            <td>
                                                <select name="pid" id="pid" autocomplete="off"  style='width:120px;'>
                                                    <option value="0">请选择分类</option>
                                                    <foreach name="cats_top" item="row">
                                                        <option value="{$row.id}"<if condition="$row.id eq $detail['pid']">selected</if>>
                                                        {$row.name}                                                
                                                        </option>
                                                        <foreach name="row['second']" item="row2">
                                                            <option value="{$row2.id}"<if condition="$row2.id eq $detail['pid']">selected</if>>
                                                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{$row2.name}                                                
                                                            </option>
                                                        </foreach>
                                                    </foreach>
                                                </select>
                                            </td>
                                        </tr>
                                       
                                        <tr>
                                            <td class="td_left">seo标题:</td>
                                            <td>
                                                <input name="seo_title" type="text" class="common_txt" value="{$detail.seo_title}" autocomplete="off" />
                                            </td>
                                        </tr>
                                         <tr>
                                                <td class="td_left">关键字</td>
                                                <td>
                                                    <textarea class="common_txt" name="keywords" id="keywords" autocomplete="off">{$detail.keywords}</textarea>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="td_left">描述</td>
                                                <td>
                                                    <textarea class="common_txt" style="height: 200px;width:400px" name="description" id="description" autocomplete="off">{$detail.description}</textarea>
                                                </td>
                                            </tr>
                                        <tr>
                                            <td class="td_left">排序:</td>
                                            <td>
                                                <input name="ord" type="text" class="common_txt" value="{$detail.ord}" autocomplete="off" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td class="td_left">是否开启:</td>
                                            <td>
                                                <input type="radio" name="is_check" value="0" autocomplete="off" 
                                        <if condition="$detail.is_check eq 0">checked</if>> 否
                                        <input type="radio" name="is_check" value="1" autocomplete="off" 
                                               <if condition="$detail.is_check eq 1">checked</if>> 是
                                        </td>
                                        </tr>
                                        <tr>
                                            <td class="td_left"></td>
                                            <td>
                                                <input type='hidden' name='id' value='{$Think.get.id}'/>
                                                <button class="btn btn-info btn-sm" type="submit">
                                                    <i class="icon-ok bigger-110 "></i>
                                                    保 存
                                                </button>

                                                <button class="btn btn-sm reset" type="button" onclick="goUrl(-1)">
                                                    <i class="icon-undo bigger-110"></i>
                                                    返 回
                                                </button>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <include file="Public:setting" />
    </div>
</div>
<include file="Public:foot" />